Map params = ['d13.v4':'1235', 'd115.v3':'1235', '1234':'d123.v3', 'c1':'sfja']
println params


def paramVs = params.findAll{ key, value -> key ==~ /^d[0-9].*[.]v[0-9].*$/ }
def paramCs = params.findAll{ key, value -> key ==~ /^c[0-9].*$/ }

def argVs = paramVs.inject([:]){ result, entry -> 
  
  def key = entry.getKey()
  def value = entry.getValue()
  def tmp = key.split("[.]")

  def d = Integer.parseInt(tmp[0].replace("d", ""))
  def v = Integer.parseInt(tmp[1].replace("v", ""))
 
  result[(d)] = [ (v) : value ]
  return result
}

def argCs = paramCs.inject([:]){result, entry ->
   def key = entry.getKey()
   def value = entry.getValue()
   def c = Integer.parseInt(key.replace("c", ""))
   
   result[(c)] = value
   return result
}

// validation column indexes

if (!(argCs.keySet().max() - argCs.keySet().min() + 1 == argCs.keySet().size() )){
  throw Exception();
}

 
// validate filter value indexes

def checkValueIndexes = argVs.every{ // argCs is external var
  def keyset = it.getValue().keySet()
  keyset.size() == argCs.keySet().size() &&
      keyset.max() == argCs.keySet().max() &&
      keyset.min() == argCs.keySet().min() 
}
if (!checkValueIndexes){
  throw Exception();
}


//Map.class.methods.each{println it}








